﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using Wicresoft.Platform.Workflows.Mobile.Tasks;

namespace Wicresoft.Platform.Workflows.Mobile.Activities
{

    public sealed class TaskActivity<T> : CodeActivity
        where T : ITask, new()
    {
        // Define an activity input argument of type string
        public InArgument<Wicresoft_Platform_Processes_Mobile> WppMobile { get; set; }

        // If your activity returns a value, derive from CodeActivity<TResult>
        // and return the value from the Execute method.
        protected override void Execute(CodeActivityContext context)
        {
            // Obtain the runtime value of the WppMobile input argument
            var p = context.GetValue(this.WppMobile);

            // Perform task
            T task = new T();
            task.Execute(p, context);
        }
    }
}
